import { UserInfo } from "@/api"
import { userInfoType } from "../actions/user"

const initialState = {} as UserInfo

// 函数 +初始化状态
// action 先写成any
const user = (state:UserInfo = initialState, action: userInfoType) => {
  
  switch (action.type) {
    case 'user/info':
      return action.info
    default:
      return state
  }
}

export default user
